\(\int \frac {(c+d \tan (e+f x))^2 (A+B \tan (e+f x)+C \tan ^2(e+f x))}{(a+b \tan (e+f x))^2} \, dx\) [62]
Optimal result
Integrand size = 45, antiderivative size = 415 \[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=-\frac {\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^2}-\frac {\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}-\frac {(b c-a d) \left (a^3 b B d-2 a^4 C d-b^4 (B c+2 A d)-a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (B c-4 C d)\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^2 f}+\frac {\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2 \tan (e+f x)}{b^2 \left (a^2+b^2\right ) f}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}
\]
[Out]
-(a^2*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))-b^2*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))-2*a*b*(2*c*(A-C)*d+B*(c^2-d^2)))
*x/(a^2+b^2)^2-(2*a*b*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))+a^2*(2*c*(A-C)*d+B*(c^2-d^2))-b^2*(2*c*(A-C)*d+B*(c^2-
d^2)))*ln(cos(f*x+e))/(a^2+b^2)^2/f-(-a*d+b*c)*(a^3*b*B*d-2*a^4*C*d-b^4*(2*A*d+B*c)-a*b^3*(2*A*c-3*B*d-2*C*c)+
a^2*b^2*(B*c-4*C*d))*ln(a+b*tan(f*x+e))/b^3/(a^2+b^2)^2/f+(A*b^2-B*a*b+2*C*a^2+C*b^2)*d^2*tan(f*x+e)/b^2/(a^2+
b^2)/f-(A*b^2-a*(B*b-C*a))*(c+d*tan(f*x+e))^2/b/(a^2+b^2)/f/(a+b*tan(f*x+e))
Rubi [A] (verified)
Time = 1.17 (sec) , antiderivative size = 415, normalized size of antiderivative = 1.00, number of
steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3726, 3718, 3707, 3698, 31,
3556} \[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=-\frac {\log (\cos (e+f x)) \left (a^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )+2 a b \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )-b^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )}{f \left (a^2+b^2\right )^2}-\frac {x \left (a^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )-2 a b \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-b^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )\right )}{\left (a^2+b^2\right )^2}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {d^2 \tan (e+f x) \left (2 a^2 C-a b B+A b^2+b^2 C\right )}{b^2 f \left (a^2+b^2\right )}-\frac {(b c-a d) \left (-2 a^4 C d+a^3 b B d+a^2 b^2 (B c-4 C d)-a b^3 (2 A c-3 B d-2 c C)-b^4 (2 A d+B c)\right ) \log (a+b \tan (e+f x))}{b^3 f \left (a^2+b^2\right )^2}
\]
[In]
Int[((c + d*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x])^2,x]
[Out]
-(((a^2*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - b^2*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - 2*a*b*(2*c
*(A - C)*d + B*(c^2 - d^2)))*x)/(a^2 + b^2)^2) - ((2*a*b*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) + a^2*(2*c*
(A - C)*d + B*(c^2 - d^2)) - b^2*(2*c*(A - C)*d + B*(c^2 - d^2)))*Log[Cos[e + f*x]])/((a^2 + b^2)^2*f) - ((b*c
- a*d)*(a^3*b*B*d - 2*a^4*C*d - b^4*(B*c + 2*A*d) - a*b^3*(2*A*c - 2*c*C - 3*B*d) + a^2*b^2*(B*c - 4*C*d))*Lo
g[a + b*Tan[e + f*x]])/(b^3*(a^2 + b^2)^2*f) + ((A*b^2 - a*b*B + 2*a^2*C + b^2*C)*d^2*Tan[e + f*x])/(b^2*(a^2
+ b^2)*f) - ((A*b^2 - a*(b*B - a*C))*(c + d*Tan[e + f*x])^2)/(b*(a^2 + b^2)*f*(a + b*Tan[e + f*x]))
Rule 31
Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]
Rule 3556
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3698
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
Rule 3707
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]
Rule 3718
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[b*C*Tan[e + f*x]*((c + d*Tan[e + f*x])
^(n + 1)/(d*f*(n + 2))), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
+ a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && !LtQ[n, -1]
Rule 3726
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*t
an[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*d^2 + c*(c*C - B*d))*(a + b*Ta
n[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - Dist[1/(d*(n + 1)*(c^2 + d^2)), I
nt[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^(n + 1)*Simp[A*d*(b*d*m - a*c*(n + 1)) + (c*C - B*d)*(b*c
*m + a*d*(n + 1)) - d*(n + 1)*((A - C)*(b*c - a*d) + B*(a*c + b*d))*Tan[e + f*x] - b*(d*(B*c - A*d)*(m + n + 1
) - C*(c^2*m - d^2*(n + 1)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c -
a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Rubi steps \begin{align*}
\text {integral}& = -\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\int \frac {(c+d \tan (e+f x)) \left ((b B-a C) (b c-2 a d)+A b (a c+2 b d)-b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)+\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d \tan ^2(e+f x)\right )}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )} \\ & = \frac {\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2 \tan (e+f x)}{b^2 \left (a^2+b^2\right ) f}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}-\frac {\int \frac {a \left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2-b c ((b B-a C) (b c-2 a d)+A b (a c+2 b d))-b^2 \left (2 a A c d-2 a c C d-A b \left (c^2-d^2\right )+a B \left (c^2-d^2\right )+b \left (c^2 C+2 B c d-C d^2\right )\right ) \tan (e+f x)-\left (a^2+b^2\right ) d (2 b c C+b B d-2 a C d) \tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b^2 \left (a^2+b^2\right )} \\ & = -\frac {\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2 \tan (e+f x)}{b^2 \left (a^2+b^2\right ) f}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}-\frac {\left ((b c-a d) \left (a^3 b B d-2 a^4 C d-b^4 (B c+2 A d)-a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (B c-4 C d)\right )\right ) \int \frac {1+\tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b^2 \left (a^2+b^2\right )^2}+\frac {\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx}{\left (a^2+b^2\right )^2} \\ & = -\frac {\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^2}-\frac {\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}+\frac {\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2 \tan (e+f x)}{b^2 \left (a^2+b^2\right ) f}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))}-\frac {\left ((b c-a d) \left (a^3 b B d-2 a^4 C d-b^4 (B c+2 A d)-a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (B c-4 C d)\right )\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (e+f x)\right )}{b^3 \left (a^2+b^2\right )^2 f} \\ & = -\frac {\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x}{\left (a^2+b^2\right )^2}-\frac {\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}-\frac {(b c-a d) \left (a^3 b B d-2 a^4 C d-b^4 (B c+2 A d)-a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (B c-4 C d)\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^2 f}+\frac {\left (A b^2-a b B+2 a^2 C+b^2 C\right ) d^2 \tan (e+f x)}{b^2 \left (a^2+b^2\right ) f}-\frac {\left (A b^2-a (b B-a C)\right ) (c+d \tan (e+f x))^2}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))} \\
\end{align*}
Mathematica [C] (verified)
Result contains complex when optimal does not.
Time = 6.41 (sec) , antiderivative size = 277, normalized size of antiderivative = 0.67
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {(-i A+B+i C) (c+i d)^2 \log (i-\tan (e+f x))}{(a+i b)^2}+\frac {(i A+B-i C) (c-i d)^2 \log (i+\tan (e+f x))}{(a-i b)^2}+\frac {2 (b c-a d) \left (-a^3 b B d+2 a^4 C d+b^4 (B c+2 A d)+a b^3 (2 A c-2 c C-3 B d)+a^2 b^2 (-B c+4 C d)\right ) \log (a+b \tan (e+f x))}{b^3 \left (a^2+b^2\right )^2}-\frac {2 \left (A b^2-a b B+2 a^2 C+b^2 C\right ) (b c-a d)^2}{b^3 \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {2 C (c+d \tan (e+f x))^2}{b (a+b \tan (e+f x))}}{2 f}
\]
[In]
Integrate[((c + d*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x])^2,x]
[Out]
((((-I)*A + B + I*C)*(c + I*d)^2*Log[I - Tan[e + f*x]])/(a + I*b)^2 + ((I*A + B - I*C)*(c - I*d)^2*Log[I + Tan
[e + f*x]])/(a - I*b)^2 + (2*(b*c - a*d)*(-(a^3*b*B*d) + 2*a^4*C*d + b^4*(B*c + 2*A*d) + a*b^3*(2*A*c - 2*c*C
- 3*B*d) + a^2*b^2*(-(B*c) + 4*C*d))*Log[a + b*Tan[e + f*x]])/(b^3*(a^2 + b^2)^2) - (2*(A*b^2 - a*b*B + 2*a^2*
C + b^2*C)*(b*c - a*d)^2)/(b^3*(a^2 + b^2)*(a + b*Tan[e + f*x])) + (2*C*(c + d*Tan[e + f*x])^2)/(b*(a + b*Tan[
e + f*x])))/(2*f)
Maple [A] (verified)
Time = 0.31 (sec) , antiderivative size = 552, normalized size of antiderivative = 1.33
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {\frac {\tan \left (f x +e \right ) C \,d^{2}}{b^{2}}-\frac {A \,a^{2} d^{2} b^{2}-2 A a \,b^{3} c d +A \,b^{4} c^{2}-B \,a^{3} d^{2} b +2 B \,a^{2} c d \,b^{2}-B a \,b^{3} c^{2}+a^{4} C \,d^{2}-2 C \,a^{3} c d b +C \,a^{2} c^{2} b^{2}}{b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-2 A \,a^{2} b^{3} c d +2 A a \,b^{4} c^{2}-2 A a \,b^{4} d^{2}+2 A \,b^{5} c d +B \,a^{4} b \,d^{2}-B \,a^{2} b^{3} c^{2}+3 B \,a^{2} b^{3} d^{2}-4 B a \,b^{4} c d +B \,b^{5} c^{2}-2 C \,a^{5} d^{2}+2 C \,a^{4} b c d -4 C \,a^{3} b^{2} d^{2}+6 C \,a^{2} b^{3} c d -2 C a \,b^{4} c^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{b^{3} \left (a^{2}+b^{2}\right )^{2}}+\frac {\frac {\left (2 A \,a^{2} c d -2 A a b \,c^{2}+2 A a b \,d^{2}-2 A \,b^{2} c d +B \,a^{2} c^{2}-B \,a^{2} d^{2}+4 B a b c d -B \,b^{2} c^{2}+B \,b^{2} d^{2}-2 C \,a^{2} c d +2 C a b \,c^{2}-2 C a b \,d^{2}+2 C \,b^{2} c d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}-2 B \,a^{2} c d +2 B a b \,c^{2}-2 B a b \,d^{2}+2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{f}\) |
\(552\) |
default |
\(\frac {\frac {\tan \left (f x +e \right ) C \,d^{2}}{b^{2}}-\frac {A \,a^{2} d^{2} b^{2}-2 A a \,b^{3} c d +A \,b^{4} c^{2}-B \,a^{3} d^{2} b +2 B \,a^{2} c d \,b^{2}-B a \,b^{3} c^{2}+a^{4} C \,d^{2}-2 C \,a^{3} c d b +C \,a^{2} c^{2} b^{2}}{b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-2 A \,a^{2} b^{3} c d +2 A a \,b^{4} c^{2}-2 A a \,b^{4} d^{2}+2 A \,b^{5} c d +B \,a^{4} b \,d^{2}-B \,a^{2} b^{3} c^{2}+3 B \,a^{2} b^{3} d^{2}-4 B a \,b^{4} c d +B \,b^{5} c^{2}-2 C \,a^{5} d^{2}+2 C \,a^{4} b c d -4 C \,a^{3} b^{2} d^{2}+6 C \,a^{2} b^{3} c d -2 C a \,b^{4} c^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{b^{3} \left (a^{2}+b^{2}\right )^{2}}+\frac {\frac {\left (2 A \,a^{2} c d -2 A a b \,c^{2}+2 A a b \,d^{2}-2 A \,b^{2} c d +B \,a^{2} c^{2}-B \,a^{2} d^{2}+4 B a b c d -B \,b^{2} c^{2}+B \,b^{2} d^{2}-2 C \,a^{2} c d +2 C a b \,c^{2}-2 C a b \,d^{2}+2 C \,b^{2} c d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}-2 B \,a^{2} c d +2 B a b \,c^{2}-2 B a b \,d^{2}+2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{f}\) |
\(552\) |
norman |
\(\frac {\frac {a \left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}-2 B \,a^{2} c d +2 B a b \,c^{2}-2 B a b \,d^{2}+2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) x}{a^{4}+2 a^{2} b^{2}+b^{4}}+\frac {C \,d^{2} \tan \left (f x +e \right )^{2}}{b f}+\frac {b \left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}-2 B \,a^{2} c d +2 B a b \,c^{2}-2 B a b \,d^{2}+2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) x \tan \left (f x +e \right )}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {A \,a^{2} d^{2} b^{2}-2 A a \,b^{3} c d +A \,b^{4} c^{2}-B \,a^{3} d^{2} b +2 B \,a^{2} c d \,b^{2}-B a \,b^{3} c^{2}+2 a^{4} C \,d^{2}-2 C \,a^{3} c d b +C \,a^{2} c^{2} b^{2}+C \,a^{2} b^{2} d^{2}}{f \,b^{3} \left (a^{2}+b^{2}\right )}}{a +b \tan \left (f x +e \right )}+\frac {\left (2 A \,a^{2} c d -2 A a b \,c^{2}+2 A a b \,d^{2}-2 A \,b^{2} c d +B \,a^{2} c^{2}-B \,a^{2} d^{2}+4 B a b c d -B \,b^{2} c^{2}+B \,b^{2} d^{2}-2 C \,a^{2} c d +2 C a b \,c^{2}-2 C a b \,d^{2}+2 C \,b^{2} c d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {\left (2 A \,a^{2} b^{3} c d -2 A a \,b^{4} c^{2}+2 A a \,b^{4} d^{2}-2 A \,b^{5} c d -B \,a^{4} b \,d^{2}+B \,a^{2} b^{3} c^{2}-3 B \,a^{2} b^{3} d^{2}+4 B a \,b^{4} c d -B \,b^{5} c^{2}+2 C \,a^{5} d^{2}-2 C \,a^{4} b c d +4 C \,a^{3} b^{2} d^{2}-6 C \,a^{2} b^{3} c d +2 C a \,b^{4} c^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) b^{3} f}\) |
\(745\) |
parallelrisch |
\(\text {Expression too large to display}\) |
\(2062\) |
risch |
\(\text {Expression too large to display}\) |
\(2406\) |
| | |
|
|
|
[In]
int((c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x,method=_RETURNVERBOSE)
[Out]
1/f*(tan(f*x+e)*C*d^2/b^2-1/b^3*(A*a^2*b^2*d^2-2*A*a*b^3*c*d+A*b^4*c^2-B*a^3*b*d^2+2*B*a^2*b^2*c*d-B*a*b^3*c^2
+C*a^4*d^2-2*C*a^3*b*c*d+C*a^2*b^2*c^2)/(a^2+b^2)/(a+b*tan(f*x+e))+(-2*A*a^2*b^3*c*d+2*A*a*b^4*c^2-2*A*a*b^4*d
^2+2*A*b^5*c*d+B*a^4*b*d^2-B*a^2*b^3*c^2+3*B*a^2*b^3*d^2-4*B*a*b^4*c*d+B*b^5*c^2-2*C*a^5*d^2+2*C*a^4*b*c*d-4*C
*a^3*b^2*d^2+6*C*a^2*b^3*c*d-2*C*a*b^4*c^2)/b^3/(a^2+b^2)^2*ln(a+b*tan(f*x+e))+1/(a^2+b^2)^2*(1/2*(2*A*a^2*c*d
-2*A*a*b*c^2+2*A*a*b*d^2-2*A*b^2*c*d+B*a^2*c^2-B*a^2*d^2+4*B*a*b*c*d-B*b^2*c^2+B*b^2*d^2-2*C*a^2*c*d+2*C*a*b*c
^2-2*C*a*b*d^2+2*C*b^2*c*d)*ln(1+tan(f*x+e)^2)+(A*a^2*c^2-A*a^2*d^2+4*A*a*b*c*d-A*b^2*c^2+A*b^2*d^2-2*B*a^2*c*
d+2*B*a*b*c^2-2*B*a*b*d^2+2*B*b^2*c*d-C*a^2*c^2+C*a^2*d^2-4*C*a*b*c*d+C*b^2*c^2-C*b^2*d^2)*arctan(tan(f*x+e)))
)
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 964 vs. \(2 (413) = 826\).
Time = 0.59 (sec) , antiderivative size = 964, normalized size of antiderivative = 2.32
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {2 \, {\left (C a^{4} b^{2} + 2 \, C a^{2} b^{4} + C b^{6}\right )} d^{2} \tan \left (f x + e\right )^{2} - 2 \, {\left (C a^{2} b^{4} - B a b^{5} + A b^{6}\right )} c^{2} + 4 \, {\left (C a^{3} b^{3} - B a^{2} b^{4} + A a b^{5}\right )} c d - 2 \, {\left (C a^{4} b^{2} - B a^{3} b^{3} + A a^{2} b^{4}\right )} d^{2} + 2 \, {\left ({\left ({\left (A - C\right )} a^{3} b^{3} + 2 \, B a^{2} b^{4} - {\left (A - C\right )} a b^{5}\right )} c^{2} - 2 \, {\left (B a^{3} b^{3} - 2 \, {\left (A - C\right )} a^{2} b^{4} - B a b^{5}\right )} c d - {\left ({\left (A - C\right )} a^{3} b^{3} + 2 \, B a^{2} b^{4} - {\left (A - C\right )} a b^{5}\right )} d^{2}\right )} f x - {\left ({\left (B a^{3} b^{3} - 2 \, {\left (A - C\right )} a^{2} b^{4} - B a b^{5}\right )} c^{2} - 2 \, {\left (C a^{5} b - {\left (A - 3 \, C\right )} a^{3} b^{3} - 2 \, B a^{2} b^{4} + A a b^{5}\right )} c d + {\left (2 \, C a^{6} - B a^{5} b + 4 \, C a^{4} b^{2} - 3 \, B a^{3} b^{3} + 2 \, A a^{2} b^{4}\right )} d^{2} + {\left ({\left (B a^{2} b^{4} - 2 \, {\left (A - C\right )} a b^{5} - B b^{6}\right )} c^{2} - 2 \, {\left (C a^{4} b^{2} - {\left (A - 3 \, C\right )} a^{2} b^{4} - 2 \, B a b^{5} + A b^{6}\right )} c d + {\left (2 \, C a^{5} b - B a^{4} b^{2} + 4 \, C a^{3} b^{3} - 3 \, B a^{2} b^{4} + 2 \, A a b^{5}\right )} d^{2}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (2 \, {\left (C a^{5} b + 2 \, C a^{3} b^{3} + C a b^{5}\right )} c d - {\left (2 \, C a^{6} - B a^{5} b + 4 \, C a^{4} b^{2} - 2 \, B a^{3} b^{3} + 2 \, C a^{2} b^{4} - B a b^{5}\right )} d^{2} + {\left (2 \, {\left (C a^{4} b^{2} + 2 \, C a^{2} b^{4} + C b^{6}\right )} c d - {\left (2 \, C a^{5} b - B a^{4} b^{2} + 4 \, C a^{3} b^{3} - 2 \, B a^{2} b^{4} + 2 \, C a b^{5} - B b^{6}\right )} d^{2}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left ({\left (C a^{3} b^{3} - B a^{2} b^{4} + A a b^{5}\right )} c^{2} - 2 \, {\left (C a^{4} b^{2} - B a^{3} b^{3} + A a^{2} b^{4}\right )} c d + {\left (2 \, C a^{5} b - B a^{4} b^{2} + {\left (A + 2 \, C\right )} a^{3} b^{3} + C a b^{5}\right )} d^{2} + {\left ({\left ({\left (A - C\right )} a^{2} b^{4} + 2 \, B a b^{5} - {\left (A - C\right )} b^{6}\right )} c^{2} - 2 \, {\left (B a^{2} b^{4} - 2 \, {\left (A - C\right )} a b^{5} - B b^{6}\right )} c d - {\left ({\left (A - C\right )} a^{2} b^{4} + 2 \, B a b^{5} - {\left (A - C\right )} b^{6}\right )} d^{2}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b^{4} + 2 \, a^{2} b^{6} + b^{8}\right )} f \tan \left (f x + e\right ) + {\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} f\right )}}
\]
[In]
integrate((c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="fricas")
[Out]
1/2*(2*(C*a^4*b^2 + 2*C*a^2*b^4 + C*b^6)*d^2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)*c*d + (2*C*a^5*b - B*a^4*b^2 + (A + 2*C)*a^3*b^3
+ C*a*b^5)*d^2 + (((A - C)*a^2*b^4 + 2*B*a*b^5 - (A - C)*b^6)*c^2 - 2*(B*a^2*b^4 - 2*(A - C)*a*b^5 - B*b^6)*c*
d - ((A - C)*a^2*b^4 + 2*B*a*b^5 - (A - C)*b^6)*d^2)*f*x)*tan(f*x + e))/((a^4*b^4 + 2*a^2*b^6 + b^8)*f*tan(f*x
+ e) + (a^5*b^3 + 2*a^3*b^5 + a*b^7)*f)
Sympy [C] (verification not implemented)
Result contains complex when optimal does not.
Time = 2.97 (sec) , antiderivative size = 16225, normalized size of antiderivative = 39.10
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display}
\]
[In]
integrate((c+d*tan(f*x+e))**2*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(a+b*tan(f*x+e))**2,x)
[Out]
Piecewise((zoo*x*(c + d*tan(e))**2*(A + B*tan(e) + C*tan(e)**2)/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((
A*c**2*x + A*c*d*log(tan(e + f*x)**2 + 1)/f - A*d**2*x + A*d**2*tan(e + f*x)/f + B*c**2*log(tan(e + f*x)**2 +
1)/(2*f) - 2*B*c*d*x + 2*B*c*d*tan(e + f*x)/f - B*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + B*d**2*tan(e + f*x)**2
/(2*f) - C*c**2*x + C*c**2*tan(e + f*x)/f - C*c*d*log(tan(e + f*x)**2 + 1)/f + C*c*d*tan(e + f*x)**2/f + C*d**
2*x + C*d**2*tan(e + f*x)**3/(3*f) - C*d**2*tan(e + f*x)/f)/a**2, Eq(b, 0)), (-A*c**2*f*x*tan(e + f*x)**2/(4*b
**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*A*c**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*
x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + A*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) -
4*b**2*f) - A*c**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*A*c**2/
(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*A*c*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(
e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 4*A*c*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b
**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c*d*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f)
+ 2*I*A*c*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + A*d**2*f*x*tan(e +
f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*d**2*f*x*tan(e + f*x)/(4*b**2
*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - A*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*t
an(e + f*x) - 4*b**2*f) - 3*A*d**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f
) + 2*I*A*d**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + I*B*c**2*f*x*tan(e + f*x)**2/
(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*c**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e +
f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*B*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + I*B*c**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*c
*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*I*B*c*d*f*x*tan(e +
f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*B*c*d*f*x/(4*b**2*f*tan(e + f*x)**2
- 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 6*B*c*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + 4*I*B*c*d/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*B*d**2*f*x*ta
n(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*B*d**2*f*x*tan(e + f*x)/(4*b
**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*I*B*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b
**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 -
8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*I*B*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)
**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*B*d**2*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 - 8*I*
b**2*f*tan(e + f*x) - 4*b**2*f) - 5*I*B*d**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x)
- 4*b**2*f) - 4*B*d**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + C*c**2*f*x*tan(e + f*
x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*C*c**2*f*x*tan(e + f*x)/(4*b**2*f*
tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - C*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(
e + f*x) - 4*b**2*f) - 3*C*c**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) +
2*I*C*c**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*I*C*c*d*f*x*tan(e + f*x)**2/(4
*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 12*C*c*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*
x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 6*I*C*c*d*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x
) - 4*b**2*f) + 4*C*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) - 8*I*C*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*ta
n(e + f*x) - 4*b**2*f) - 4*C*c*d*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x)
- 4*b**2*f) - 10*I*C*c*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 8*C*c*
d/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 9*C*d**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan
(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 18*I*C*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 -
8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 9*C*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**
2*f) + 4*I*C*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x)
- 4*b**2*f) + 8*C*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f
*x) - 4*b**2*f) - 4*I*C*d**2*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*
b**2*f) + 4*C*d**2*tan(e + f*x)**3/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 19*C*d**2
*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 14*I*C*d**2/(4*b**2*f*tan(e +
f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f), Eq(a, -I*b)), (-A*c**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*
x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2
*f*tan(e + f*x) - 4*b**2*f) + A*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - A*c
**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c**2/(4*b**2*f*tan(e
+ f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*
I*b**2*f*tan(e + f*x) - 4*b**2*f) + 4*A*c*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + 2*I*A*c*d*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c*d*tan
(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + A*d**2*f*x*tan(e + f*x)**2/(4*b**2
*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*A*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)*
*2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - A*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*
b**2*f) - 3*A*d**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*d**2/(
4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*B*c**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e
+ f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*c**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b*
*2*f*tan(e + f*x) - 4*b**2*f) + I*B*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) -
I*B*c**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*c*d*f*x*tan(e + f
*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 4*I*B*c*d*f*x*tan(e + f*x)/(4*b**2*f*
tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*B*c*d*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan
(e + f*x) - 4*b**2*f) - 6*B*c*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) -
4*I*B*c*d/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*I*B*d**2*f*x*tan(e + f*x)**2/(4
*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*B*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*
x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*B*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + 2*B*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(
e + f*x) - 4*b**2*f) + 4*I*B*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f
*tan(e + f*x) - 4*b**2*f) - 2*B*d**2*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f
*x) - 4*b**2*f) + 5*I*B*d**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*
B*d**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + C*c**2*f*x*tan(e + f*x)**2/(4*b**2*f*
tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*C*c**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2
+ 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - C*c**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**
2*f) - 3*C*c**2*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*C*c**2/(4*b
**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 6*I*C*c*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e +
f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 12*C*c*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2
*f*tan(e + f*x) - 4*b**2*f) + 6*I*C*c*d*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) +
4*C*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*
f) + 8*I*C*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b
**2*f) - 4*C*c*d*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 10
*I*C*c*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 8*C*c*d/(4*b**2*f*tan(
e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 9*C*d**2*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8
*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 18*I*C*d**2*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) + 9*C*d**2*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*I*C*d**
2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 8
*C*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f)
+ 4*I*C*d**2*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 4*C*d*
*2*tan(e + f*x)**3/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 19*C*d**2*tan(e + f*x)/(4
*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 14*I*C*d**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b*
*2*f*tan(e + f*x) - 4*b**2*f), Eq(a, I*b)), (x*(c + d*tan(e))**2*(A + B*tan(e) + C*tan(e)**2)/(a + b*tan(e))**
2, Eq(f, 0)), (-2*A*a**4*b**2*d**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f
*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a**3*b**3*c**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*ta
n(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*A*a**3*b**3*
c*d*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e
+ f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a**3*b**3*c*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a
**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4
*A*a**3*b**3*c*d/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*
a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a**3*b**3*d**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**
3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a**2*b**4*c**2*f*x*tan(e + f
*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*
b**8*f*tan(e + f*x)) + 4*A*a**2*b**4*c**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x)
+ 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a**2*b**4*c**2*log(ta
n(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) +
2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a**2*b**4*c**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*
b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 8*A*a**2*b**4*c*d*f*x/(2*a**5*b**3
*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f
*x)) - 4*A*a**2*b**4*c*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*
a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a**2*b**4*c*d*log(tan(e +
f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e +
f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a**2*b**4*d**2*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4
*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*A*a**2*
b**4*d**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*
tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a**2*b**4*d**2*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*
f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*
x)) - 2*A*a**2*b**4*d**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f
*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a*b**5*c**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) +
4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*A*a*b**5*c**2*log(a/b + t
an(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e +
f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*a*b**5*c**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**
3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e +
f*x)) + 8*A*a*b**5*c*d*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b
**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*A*a*b**5*c*d*log(a/b + tan(e + f*x))/(2*a**5*b**3
*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f
*x)) - 2*A*a*b**5*c*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4
*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*A*a*b**5*c*d/(2*a**5*b**3*f + 2*a**4*b**4*
f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a*b**5
*d**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*
f + 2*b**8*f*tan(e + f*x)) - 4*A*a*b**5*d**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4
*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*a*b**
5*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a
**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*b**6*c**2*f*x*tan(e + f*x)/(2*a**5*b**3*f
+ 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)
) - 2*A*b**6*c**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2
*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*A*b**6*c*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4
*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*A*
b**6*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4
*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*A*b**6*d**2*f*x*tan(e + f*x)/(2*a**5*b**3*
f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*
x)) + 2*B*a**5*b*d**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*
a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*B*a**5*b*d**2/(2*a**5*b**3*f + 2*a**4*b**4*
f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*B*a**4*b
**2*c*d/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f
+ 2*b**8*f*tan(e + f*x)) + 2*B*a**4*b**2*d**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**
4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*B*a**3
*b**3*c**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f
*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + B*a**3*b**3*c**2*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f
+ 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x
)) + 2*B*a**3*b**3*c**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*
x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*B*a**3*b**3*c*d*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) +
4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 6*B*a**3*b**3*d**2*log(a/b
+ tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*
a*b**7*f + 2*b**8*f*tan(e + f*x)) - B*a**3*b**3*d**2*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*t
an(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*B*a**3*b**3
*d**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f +
2*b**8*f*tan(e + f*x)) + 4*B*a**2*b**4*c**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f +
4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*B*a**2*b**4*c**2*log(a/b + tan(e + f*x))*
tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b*
*7*f + 2*b**8*f*tan(e + f*x)) + B*a**2*b**4*c**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4
*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*B*
a**2*b**4*c*d*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan
(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 8*B*a**2*b**4*c*d*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2
*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) +
4*B*a**2*b**4*c*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a*
*2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*B*a**2*b**4*c*d/(2*a**5*b**3*f + 2*a**4*b**4*
f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*B*a**2*b
**4*d**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b*
*7*f + 2*b**8*f*tan(e + f*x)) + 6*B*a**2*b**4*d**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**
4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - B*a
**2*b**4*d**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*
f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*B*a*b**5*c**2*f*x*tan(e + f*x)/(2*a**
5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan
(e + f*x)) + 2*B*a*b**5*c**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5
*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - B*a*b**5*c**2*log(tan(e + f*x)**2 + 1)
/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**
8*f*tan(e + f*x)) + 2*B*a*b**5*c**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*
f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*B*a*b**5*c*d*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e
+ f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 8*B*a*b**5*c*d*lo
g(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f
*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*B*a*b**5*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*
a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*
tan(e + f*x)) - 4*B*a*b**5*d**2*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f +
4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + B*a*b**5*d**2*log(tan(e + f*x)**2 + 1)/(2*
a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*
tan(e + f*x)) + 2*B*b**6*c**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x)
+ 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - B*b**6*c**2*log(tan(e +
f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e +
f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*B*b**6*c*d*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(
e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + B*b**6*d**2*log(
tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*
tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*C*a**6*d**2*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*
a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) -
4*C*a**6*d**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b
**7*f + 2*b**8*f*tan(e + f*x)) + 4*C*a**5*b*c*d*log(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e +
f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*C*a**5*b*c*d/(2*a
**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*t
an(e + f*x)) - 4*C*a**5*b*d**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x
) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a**4*b**2*c**2/(2*a
**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*t
an(e + f*x)) + 4*C*a**4*b**2*c*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f
*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 8*C*a**4*b**2*d**2*lo
g(a/b + tan(e + f*x))/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x)
+ 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*a**4*b**2*d**2*tan(e + f*x)**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan
(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 6*C*a**4*b**2*d
**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*
b**8*f*tan(e + f*x)) - 2*C*a**3*b**3*c**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*
a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 12*C*a**3*b**3*c*d*log(a/b + tan(e + f*x))/(2
*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f
*tan(e + f*x)) - 2*C*a**3*b**3*c*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a*
*3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*C*a**3*b**3*c*d/(2*a**5*b**3*
f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*
x)) + 2*C*a**3*b**3*d**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e
+ f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 8*C*a**3*b**3*d**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**
5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan
(e + f*x)) - 2*C*a**2*b**4*c**2*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f +
4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 4*C*a**2*b**4*c**2*log(a/b + tan(e + f*x))
/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**
8*f*tan(e + f*x)) + 2*C*a**2*b**4*c**2*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) +
4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a**2*b**4*c**2/(2*a**5*
b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e
+ f*x)) - 8*C*a**2*b**4*c*d*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*t
an(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 12*C*a**2*b**4*c*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2
*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f
*tan(e + f*x)) - 2*C*a**2*b**4*c*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e
+ f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*a**2*b**4*d**2
*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2
*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a**2*b**4*d**2*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*
f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 4*C*a**2*b
**4*d**2*tan(e + f*x)**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f
*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a**2*b**4*d**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4
*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*a*b**5*c**2*f*x/(2*a**5*
b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e
+ f*x)) - 4*C*a*b**5*c**2*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) +
4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*a*b**5*c**2*log(tan(e +
f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e +
f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 8*C*a*b**5*c*d*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*t
an(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*a*b**5*c*
d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e +
f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a*b**5*d**2*f*x/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x)
+ 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*a*b**5*d**2*log(tan(e
+ f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e
+ f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*b**6*c**2*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*
tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*C*b**6*c*d
*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b*
*6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) - 2*C*b**6*d**2*f*x*tan(e + f*x)/(2*a**5*b**3*f + 2*a*
*4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e + f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)) + 2*
C*b**6*d**2*tan(e + f*x)**2/(2*a**5*b**3*f + 2*a**4*b**4*f*tan(e + f*x) + 4*a**3*b**5*f + 4*a**2*b**6*f*tan(e
+ f*x) + 2*a*b**7*f + 2*b**8*f*tan(e + f*x)), True))
Maxima [A] (verification not implemented)
none
Time = 0.31 (sec) , antiderivative size = 496, normalized size of antiderivative = 1.20
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {2 \, C d^{2} \tan \left (f x + e\right )}{b^{2}} + \frac {2 \, {\left ({\left ({\left (A - C\right )} a^{2} + 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{2} - 2 \, {\left (B a^{2} - 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c d - {\left ({\left (A - C\right )} a^{2} + 2 \, B a b - {\left (A - C\right )} b^{2}\right )} d^{2}\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left ({\left (B a^{2} b^{3} - 2 \, {\left (A - C\right )} a b^{4} - B b^{5}\right )} c^{2} - 2 \, {\left (C a^{4} b - {\left (A - 3 \, C\right )} a^{2} b^{3} - 2 \, B a b^{4} + A b^{5}\right )} c d + {\left (2 \, C a^{5} - B a^{4} b + 4 \, C a^{3} b^{2} - 3 \, B a^{2} b^{3} + 2 \, A a b^{4}\right )} d^{2}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}} + \frac {{\left ({\left (B a^{2} - 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{2} + 2 \, {\left ({\left (A - C\right )} a^{2} + 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c d - {\left (B a^{2} - 2 \, {\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left ({\left (C a^{2} b^{2} - B a b^{3} + A b^{4}\right )} c^{2} - 2 \, {\left (C a^{3} b - B a^{2} b^{2} + A a b^{3}\right )} c d + {\left (C a^{4} - B a^{3} b + A a^{2} b^{2}\right )} d^{2}\right )}}{a^{3} b^{3} + a b^{5} + {\left (a^{2} b^{4} + b^{6}\right )} \tan \left (f x + e\right )}}{2 \, f}
\]
[In]
integrate((c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="maxima")
[Out]
1/2*(2*C*d^2*tan(f*x + e)/b^2 + 2*(((A - C)*a^2 + 2*B*a*b - (A - C)*b^2)*c^2 - 2*(B*a^2 - 2*(A - C)*a*b - B*b^
2)*c*d - ((A - C)*a^2 + 2*B*a*b - (A - C)*b^2)*d^2)*(f*x + e)/(a^4 + 2*a^2*b^2 + b^4) - 2*((B*a^2*b^3 - 2*(A -
C)*a*b^4 - B*b^5)*c^2 - 2*(C*a^4*b - (A - 3*C)*a^2*b^3 - 2*B*a*b^4 + A*b^5)*c*d + (2*C*a^5 - B*a^4*b + 4*C*a^
3*b^2 - 3*B*a^2*b^3 + 2*A*a*b^4)*d^2)*log(b*tan(f*x + e) + a)/(a^4*b^3 + 2*a^2*b^5 + b^7) + ((B*a^2 - 2*(A - C
)*a*b - B*b^2)*c^2 + 2*((A - C)*a^2 + 2*B*a*b - (A - C)*b^2)*c*d - (B*a^2 - 2*(A - C)*a*b - B*b^2)*d^2)*log(ta
n(f*x + e)^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*((C*a^2*b^2 - B*a*b^3 + A*b^4)*c^2 - 2*(C*a^3*b - B*a^2*b^2 + A*
a*b^3)*c*d + (C*a^4 - B*a^3*b + A*a^2*b^2)*d^2)/(a^3*b^3 + a*b^5 + (a^2*b^4 + b^6)*tan(f*x + e)))/f
Giac [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 893 vs. \(2 (413) = 826\).
Time = 0.84 (sec) , antiderivative size = 893, normalized size of antiderivative = 2.15
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {2 \, C d^{2} \tan \left (f x + e\right )}{b^{2}} + \frac {2 \, {\left (A a^{2} c^{2} - C a^{2} c^{2} + 2 \, B a b c^{2} - A b^{2} c^{2} + C b^{2} c^{2} - 2 \, B a^{2} c d + 4 \, A a b c d - 4 \, C a b c d + 2 \, B b^{2} c d - A a^{2} d^{2} + C a^{2} d^{2} - 2 \, B a b d^{2} + A b^{2} d^{2} - C b^{2} d^{2}\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {{\left (B a^{2} c^{2} - 2 \, A a b c^{2} + 2 \, C a b c^{2} - B b^{2} c^{2} + 2 \, A a^{2} c d - 2 \, C a^{2} c d + 4 \, B a b c d - 2 \, A b^{2} c d + 2 \, C b^{2} c d - B a^{2} d^{2} + 2 \, A a b d^{2} - 2 \, C a b d^{2} + B b^{2} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (B a^{2} b^{3} c^{2} - 2 \, A a b^{4} c^{2} + 2 \, C a b^{4} c^{2} - B b^{5} c^{2} - 2 \, C a^{4} b c d + 2 \, A a^{2} b^{3} c d - 6 \, C a^{2} b^{3} c d + 4 \, B a b^{4} c d - 2 \, A b^{5} c d + 2 \, C a^{5} d^{2} - B a^{4} b d^{2} + 4 \, C a^{3} b^{2} d^{2} - 3 \, B a^{2} b^{3} d^{2} + 2 \, A a b^{4} d^{2}\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}} + \frac {2 \, {\left (B a^{2} b^{4} c^{2} \tan \left (f x + e\right ) - 2 \, A a b^{5} c^{2} \tan \left (f x + e\right ) + 2 \, C a b^{5} c^{2} \tan \left (f x + e\right ) - B b^{6} c^{2} \tan \left (f x + e\right ) - 2 \, C a^{4} b^{2} c d \tan \left (f x + e\right ) + 2 \, A a^{2} b^{4} c d \tan \left (f x + e\right ) - 6 \, C a^{2} b^{4} c d \tan \left (f x + e\right ) + 4 \, B a b^{5} c d \tan \left (f x + e\right ) - 2 \, A b^{6} c d \tan \left (f x + e\right ) + 2 \, C a^{5} b d^{2} \tan \left (f x + e\right ) - B a^{4} b^{2} d^{2} \tan \left (f x + e\right ) + 4 \, C a^{3} b^{3} d^{2} \tan \left (f x + e\right ) - 3 \, B a^{2} b^{4} d^{2} \tan \left (f x + e\right ) + 2 \, A a b^{5} d^{2} \tan \left (f x + e\right ) - C a^{4} b^{2} c^{2} + 2 \, B a^{3} b^{3} c^{2} - 3 \, A a^{2} b^{4} c^{2} + C a^{2} b^{4} c^{2} - A b^{6} c^{2} - 2 \, B a^{4} b^{2} c d + 4 \, A a^{3} b^{3} c d - 4 \, C a^{3} b^{3} c d + 2 \, B a^{2} b^{4} c d + C a^{6} d^{2} - A a^{4} b^{2} d^{2} + 3 \, C a^{4} b^{2} d^{2} - 2 \, B a^{3} b^{3} d^{2} + A a^{2} b^{4} d^{2}\right )}}{{\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} {\left (b \tan \left (f x + e\right ) + a\right )}}}{2 \, f}
\]
[In]
integrate((c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="giac")
[Out]
1/2*(2*C*d^2*tan(f*x + e)/b^2 + 2*(A*a^2*c^2 - C*a^2*c^2 + 2*B*a*b*c^2 - A*b^2*c^2 + C*b^2*c^2 - 2*B*a^2*c*d +
4*A*a*b*c*d - 4*C*a*b*c*d + 2*B*b^2*c*d - A*a^2*d^2 + C*a^2*d^2 - 2*B*a*b*d^2 + A*b^2*d^2 - C*b^2*d^2)*(f*x +
e)/(a^4 + 2*a^2*b^2 + b^4) + (B*a^2*c^2 - 2*A*a*b*c^2 + 2*C*a*b*c^2 - B*b^2*c^2 + 2*A*a^2*c*d - 2*C*a^2*c*d +
4*B*a*b*c*d - 2*A*b^2*c*d + 2*C*b^2*c*d - B*a^2*d^2 + 2*A*a*b*d^2 - 2*C*a*b*d^2 + B*b^2*d^2)*log(tan(f*x + e)
^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(B*a^2*b^3*c^2 - 2*A*a*b^4*c^2 + 2*C*a*b^4*c^2 - B*b^5*c^2 - 2*C*a^4*b*c*d
+ 2*A*a^2*b^3*c*d - 6*C*a^2*b^3*c*d + 4*B*a*b^4*c*d - 2*A*b^5*c*d + 2*C*a^5*d^2 - B*a^4*b*d^2 + 4*C*a^3*b^2*d
^2 - 3*B*a^2*b^3*d^2 + 2*A*a*b^4*d^2)*log(abs(b*tan(f*x + e) + a))/(a^4*b^3 + 2*a^2*b^5 + b^7) + 2*(B*a^2*b^4*
c^2*tan(f*x + e) - 2*A*a*b^5*c^2*tan(f*x + e) + 2*C*a*b^5*c^2*tan(f*x + e) - B*b^6*c^2*tan(f*x + e) - 2*C*a^4*
b^2*c*d*tan(f*x + e) + 2*A*a^2*b^4*c*d*tan(f*x + e) - 6*C*a^2*b^4*c*d*tan(f*x + e) + 4*B*a*b^5*c*d*tan(f*x + e
) - 2*A*b^6*c*d*tan(f*x + e) + 2*C*a^5*b*d^2*tan(f*x + e) - B*a^4*b^2*d^2*tan(f*x + e) + 4*C*a^3*b^3*d^2*tan(f
*x + e) - 3*B*a^2*b^4*d^2*tan(f*x + e) + 2*A*a*b^5*d^2*tan(f*x + e) - C*a^4*b^2*c^2 + 2*B*a^3*b^3*c^2 - 3*A*a^
2*b^4*c^2 + C*a^2*b^4*c^2 - A*b^6*c^2 - 2*B*a^4*b^2*c*d + 4*A*a^3*b^3*c*d - 4*C*a^3*b^3*c*d + 2*B*a^2*b^4*c*d
+ C*a^6*d^2 - A*a^4*b^2*d^2 + 3*C*a^4*b^2*d^2 - 2*B*a^3*b^3*d^2 + A*a^2*b^4*d^2)/((a^4*b^3 + 2*a^2*b^5 + b^7)*
(b*tan(f*x + e) + a)))/f
Mupad [B] (verification not implemented)
Time = 32.73 (sec) , antiderivative size = 3958, normalized size of antiderivative = 9.54
\[
\int \frac {(c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display}
\]
[In]
int(((c + d*tan(e + f*x))^2*(A + B*tan(e + f*x) + C*tan(e + f*x)^2))/(a + b*tan(e + f*x))^2,x)
[Out]
(log((2*C^2*a^5*d^4 + 4*C^2*a^3*b^2*d^4 - 2*C^2*a^5*c^2*d^2 - A*B*b^5*c^4 - 2*A*C*a^5*d^4 + B*C*b^5*c^4 - A^2*
a*b^4*c^4 - A^2*a*b^4*d^4 + B^2*a*b^4*c^4 + B^2*a*b^4*d^4 - C^2*a*b^4*c^4 + 2*A^2*b^5*c*d^3 - 2*A^2*b^5*c^3*d
+ C^2*a*b^4*d^4 + 2*B^2*b^5*c^3*d - 4*C^2*a^3*b^2*c^2*d^2 + A*B*a^2*b^3*c^4 + 3*A*B*a^2*b^3*d^4 - 4*A*C*a^3*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